//
//  UIScrollView+TRPullAndLoadMore.m
//  Travel
//
//  Created by Demon on 2017/9/16.
//  Copyright © 2017年 Demon. All rights reserved.
//

#import "UIScrollView+TRPullAndLoadMore.h"

@implementation UIScrollView (TRPullAndLoadMore)

- (void)addHeadFresh:(id)target selector:(SEL)selector {
  MJRefreshNormalHeader * refreshHeader = [MJRefreshNormalHeader headerWithRefreshingTarget:target refreshingAction:selector];
    refreshHeader.lastUpdatedTimeLabel.hidden = NO;
    refreshHeader.stateLabel.hidden = NO;
    refreshHeader.automaticallyChangeAlpha = YES;
    self.mj_header = refreshHeader;
}

- (void)addfooterFresh:(id)target selector:(SEL)selector {
    MJRefreshBackNormalFooter *refreshFooter = [MJRefreshBackNormalFooter footerWithRefreshingTarget:target refreshingAction:@selector(selector)];
    refreshFooter.automaticallyChangeAlpha = YES;
    //    refreshFooter.refreshingTitleHidden = NO;
    self.mj_footer = refreshFooter;
}

- (void)endFresh {
    [self.mj_header endRefreshing];
    [self.mj_footer endRefreshing];
}

@end
